package pizza2;

/**
 * @Auther: xiaofei
 * @Date: 2021/6/8 - 06 - 08 - 9:47
 * @Description: pizza2
 * @version: 1.0
 */
public class BaconPizza extends Pizza {
    //属性
    private double weight;
    //方法

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }
    //重写父类方法
    public String showPizza(){
        return super.showPizza()+"\n请选择要添加的培根克数："+weight;
    }
    //构造器

    public BaconPizza() {
    }

    public BaconPizza(String name, int size, double price, double weight) {
        super(name, size, price);
        this.weight = weight;
    }
}
